package com.hjn.springboot.springbootinterceptor.timer;

import java.time.LocalDateTime;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author huaijn
 * @date 2022/5/5 /0005-14:17
 * @description todo
 */
//@Configuration
//@EnableScheduling//开启定时器
public class SpringbootScheduleTask {

  @Scheduled(cron = "0/5 * * * * ?")
  private void configureTask() {
    System.out.println(Thread.currentThread().getName() + "任务被执行了......" + LocalDateTime.now().toString());
  }
}
